/*    */ package com.zimbra.cs.account.ldap.upgrade;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.cs.account.Entry;
/*    */ import com.zimbra.cs.account.ldap.LdapProv;
/*    */ import com.zimbra.cs.ldap.LdapClient;
/*    */ import com.zimbra.cs.ldap.LdapServerType;
/*    */ import com.zimbra.cs.ldap.LdapUsage;
/*    */ import com.zimbra.cs.ldap.ZLdapContext;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class BUG_75650
/*    */   extends UpgradeOp
/*    */ {
/*    */   private static final String ATTR_NAME = "zimbraMailPurgeBatchSize";
/*    */   private static final int OLD_VALUE = 10000;
/*    */   private static final int NEW_VALUE = 1000;
/*    */   
/*    */   void doUpgrade()
/*    */     throws ServiceException
/*    */   {
/* 38 */     ZLdapContext zlc = LdapClient.getContext(LdapServerType.MASTER, LdapUsage.UPGRADE);
/*    */     try {
/* 40 */       doGlobalConfig(zlc);
/*    */     } finally {
/* 42 */       LdapClient.closeContext(zlc);
/*    */     }
/*    */   }
/*    */   
/*    */   private void doGlobalConfig(ZLdapContext zlc) throws ServiceException {
/* 47 */     doEntry(zlc, this.prov.getConfig());
/*    */   }
/*    */   
/*    */   private void doEntry(ZLdapContext zlc, Entry entry) throws ServiceException {
/* 51 */     String entryName = entry.getLabel();
/*    */     
/* 53 */     this.printer.println();
/* 54 */     this.printer.println("------------------------------");
/* 55 */     this.printer.println("Checking zimbraMailPurgeBatchSize on " + entryName);
/*    */     
/* 57 */     int curValue = entry.getIntAttr("zimbraMailPurgeBatchSize", 1000);
/* 58 */     if (curValue == 10000) {
/* 59 */       Map<String, Object> attrs = new HashMap();
/* 60 */       this.printer.println("Changing zimbraMailPurgeBatchSize on " + entryName + " from " + 10000 + " to " + 1000);
/* 61 */       attrs.put("zimbraMailPurgeBatchSize", Integer.valueOf(1000));
/* 62 */       modifyAttrs(entry, attrs);
/*    */     } else {
/* 64 */       this.printer.println("Current value of zimbraMailPurgeBatchSize on " + entryName + " is " + curValue + " - not changed");
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/ldap/upgrade/BUG_75650.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */